<?php
declare(strict_types=1);

$cfg['AllowArbitraryServer'] = true;
$cfg['PmaAbsoluteUri'] = 'http://192.168.1.29/phpmyadmin/'; // 访问phpmyadmin的地址，和宿主机的nginx conf配置一直
$cfg['ThemeManager'] = false;
$cfg['ThemeDefault'] = 'pmahomme';
$cfg['ServerDefault'] = 0;
$cfg['ShowChgPassword'] = false;
$cfg['blowfish_secret'] = '633e12cf12edfe5f0f226a8a81b5224b';

$connect_hosts = array(
    1=>array(
        "verbose" =>"RioRush-Local",
        "host"   => "192.168.1.25",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ),
    2=>array(
        "verbose" =>"ReelRush-Local",
        "host" =>"192.168.1.26",
        "port" =>3306,
        "user" =>"admin",
        "password" =>"admin"
    ),
    3=>array(
        "verbose" =>"JoyCoin-Local",
        "host"   => "192.168.1.28",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ),    
    4=>array(
        "verbose" =>"Ugames-Local",
        "host"   => "192.168.1.27",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ),
    5=>array(
        "verbose" =>"Zhongtai-Local",
        "host"   => "192.168.1.29",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ), 
    6 =>array(
        "verbose" =>"Alegria-Local",
        "host"   => "192.168.1.30",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ),
    7 =>array(
        "verbose" =>"Hahahub-Local",
        "host"   => "192.168.1.118",
        "port" => 3306,
        "user"   => "admin",
        "password" => "admin"
    ),

);
// 注意使用for循环时，如果上面的connect_hosts配置只有一个，会出现phpmyadmin不显示服务器。解决办法是connect_hosts配置相同的两个 
for ($i=1;$i<=count($connect_hosts);$i++) {
     $cfg['Servers'][$i]['auth_type'] = 'config';
     $cfg['Servers'][$i]['verbose'] = $connect_hosts[$i]['verbose'];
     $cfg['Servers'][$i]['host'] = $connect_hosts[$i]['host'];
     $cfg['Servers'][$i]['port'] = $connect_hosts[$i]['port'];
     $cfg['Servers'][$i]['connect_type'] = 'tcp';
     $cfg['Servers'][$i]['compress'] = false;
     $cfg['Servers'][$i]['extension'] = 'mysqli';
     $cfg['Servers'][$i]['AllowNoPassword'] = true;
     $cfg['Servers'][$i]['user'] = $connect_hosts[$i]['user'];
     $cfg['Servers'][$i]['password'] = $connect_hosts[$i]['password'];
     $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
     $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
     $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
     $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

}